<?php
/*
 *   This file is part of verbum.
 *
 *   poat is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   poat is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with poat.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * 	 Copyright (c) 2008 Sergio Gabriel Teves <gabriel.sgt at gmail.com>
 */

$ts = new teamsetting;
$ts->teamid = getTeamId($CURRENT_USER);
$list = $loader->loadList($ts);

?>
{   xtype:"fieldset",
    autoHeight:true,
    labelWidth:1,
    items:[{
        xtype:"checkbox",
        hideLabel: true,
        boxLabel: "<?php echo String::format(s("Replace header field '{0}' with:",null,true),"Language-Team"); ?>",
        name:"rplheader",
        id:"rplheader",
        <?php if (array_key_exists(RPL_HEADER, $list)) {
        	echo "checked: true";	
        } else {
        	echo "checked: false";
        }
        ?>
      	},
      	{
	        xtype:"textfield",
	        name: "rplheadermsg",
	        id: "rplheadermsg",
	        hideLabel: true,
	        value:"<?php echo ($list[RPL_HEADER] == null ? "" : $list[RPL_HEADER]->value); ?>",
	        maxLength: 100,
	       	width: 350,
	       	invalidText:"<?php echo s("You should write something here.",null,true); ?>"
      	},
    	{
        xtype:"checkbox",
        hideLabel: true,
        boxLabel: "<?php echo s("Automatically send account invitation",null,true); ?>",
        name:"autoacc",
        <?php if (array_key_exists(AUTO_SEND, $list)) {
        	echo "checked: true";	
        } else {
        	echo "checked: false";
        }
        ?>
      },{
        xtype:"checkbox",
        hideLabel: true,
        boxLabel: "<?php echo s("Auto-reply on new account request",null,true); ?>",
        name:"autoreply",
        id: "autoreply",
        <?php if (array_key_exists(AUTO_REPLY, $list)) {
        	echo "checked: true";	
        } else {
        	echo "checked: false";
        }
        ?>
      },{
        xtype:"textarea",
        name: "replymsg",
        id: "replymsg",
        fieldLabel:"<?php echo s("Auto-reply message",null,true); ?>",
        value:"<?php echo ($list[AUTO_REPLY_MSG] == null ? "" : $list[AUTO_REPLY_MSG]->value); ?>",
        maxLength: 1000,
        width: 350,
        height: 120,
        invalidText:"<?php echo s("An auto-reply message is required.",null,true); ?>"
      }]
}
